<template>
	<!-- 提币详情 -->
	<view class="mention-detail">
		<nav-bar :title="i18n.mention.detail" @_back="_back"/>
		<view class="container">
			<view class="detail-box">
				<view class="left-box">
					<text>{{i18n.mention.time}}</text>
				</view>
				<view class="right-box">
					<text>{{info.create_time}}</text>
				</view>
			</view>
			<view class="detail-box">
				<view class="left-box">
					<text>{{i18n.mention.quantity}}</text>
				</view>
				<view class="right-box">
					<text>{{info.number}}</text>
				</view>
			</view>
			<view class="detail-box">
				<view class="left-box">
					<text>{{i18n.mention.balance}}</text>
				</view>
				<view class="right-box">
					<text>{{info.lever_balance}}</text>
				</view>
			</view>
			<view class="detail-box">
				<view class="left-box">
					<text>{{i18n.mention.charges}}</text>
				</view>
				<view class="right-box">
					<text>{{info.rate}}</text>
				</view>
			</view>
			<view class="detail-box">
				<view class="left-box">
					<text>{{i18n.mention.real_number}}</text>
				</view>
				<view class="right-box">
					<text>{{info.real_number}}</text>
				</view>
			</view>
			<view class="detail-box">
				<view class="left-box">
					<text>{{i18n.mention.chain}}</text>
				</view>
				<view class="right-box">
					<text>{{info.links}}</text>
				</view>
			</view>
			<view class="detail-box">
				<view class="left-box">
					<text>{{i18n.mention.walletAddress}}</text>
				</view>
				<view class="right-box">
					<text>{{info.address}}</text>
				</view>
			</view>
			<view class="detail-box">
				<view class="left-box">
					<text>{{i18n.mention.status}}</text>
				</view>
				<view class="right-box">
					<text>{{info.status | type(i18n)}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import minix from './mininx/index.js'
	import { walletOut_info } from '@/api/index.js'
	export default {
		mixins: [minix],
		data() {
			return {
				info: {}
			}
		},
		computed: {
			i18n() {
				return this.$t('message');
			},
		},
		filters: {
			type(val, i18n) {
				let name = '';
				switch (val) {
					case 1:
					name = i18n.common.pending;
					break;
					case 2:
					name = i18n.common.success;
					break;
					case 3:
					name = i18n.common.fail
					break;
				}
				return name;
			}
		},
		onLoad(data) {
			this.loadInfo(data.id)
		},
		methods: {
			async loadInfo(id) {
				let {error, res} = await walletOut_info({id: id});
				if (error) return;
				this.info = res;
			}
		}
	}
</script>

<style lang="scss" scoped>
	.mention-detail {
		.detail-box {
			height: 84rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-bottom: 1px solid rgba(255, 255, 255, .1);
			.left-box {
				color: rgba(255, 255, 255, .54);
			}
			.right-box {
				color: #fff;
			}
		}
	}
</style>
